<?php
$content->assign("formAction", Utils::generateSEOUrl($lang, $section, "save"));

// Options
$contentOptions = array(
	0 => array(
		"text" => "Volver",
		"link" => Utils::generateSEOUrl($lang, $section),
		"icon" => IMAGES_URL."icons/small/white/Home.png"
	),
);
$content->assign("contentOptions", $contentOptions);

$id = $_GET["id"];

$query = "SELECT id, question, answer, position FROM faq WHERE id = '$id'";

if (!$res1 = $db->runQuery($query)) {
	$content->assign("error", "Error de MySQL: ".$db->getErrorDescription());
} else {
	if (!$db->getRowCount($res1)) {
		$content->assign("error", "La consulta no ha devuelto resultados.");
	} else {
		$row1 = $db->getRow($res1);
		foreach ($row1 as $key=>$value) {
			$content->assign($key, stripslashes(utf8_encode($value)));
		}
	}
}
?>
